package com.gs.netty.websocket.remoting.resp;

import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandler;
import io.netty.channel.ChannelHandlerContext;

public class SocketResponse implements Response {

    private ChannelHandlerContext channelHandlerContext;
    public SocketResponse(ChannelHandlerContext channelHandlerContext) {
        this.channelHandlerContext = channelHandlerContext;
    }

    @Override
    public void writeAndFlush(Object o) {
        ByteBuf buffer = channelHandlerContext.alloc().buffer();
        channelHandlerContext.channel().writeAndFlush(o);
    }
}
